{% extends base.html %}
{% block body %}

<div class="col-md-12 hide">
  <form id="searchForm1" method="GET" action="{{?action,'/search/search'}}">
      <div class="input-group">
          <input type="text" id="key" name="key" class="search-input" value="{{?key}}" placeholder="输入指令或搜索关键字" />
          <button class="search-btn">搜&nbsp;索</button>
      </div>
      <div class="col-md-12">
        <input type="radio" name="category" value="default" default-value="{{?category}}">默认
        <input type="radio" name="category" value="dict" default-value="{{?category}}">词典
        <input type="radio" name="category" value="content" default-value="{{?category}}">全文搜索
        <input type="radio" name="category" value="message" default-value="{{?category}}">备忘
      </div>
  </form>
</div>

<div class="col-md-12 bottom-offset-1" style="background-color:#eee; padding-left:5px;">
  <span>搜索条件:</span> 
  <a class="link x-radio" href="/search?key={{?key}}&category=default" data-option="default" data-value="{{?category}}">默认</a>
  <a class="link x-radio" href="/search?key={{?key}}&category=content" data-option="content" data-value="{{?category}}">内容</a>
  <a class="link x-radio" href="/search?key={{?key}}&category=dict" data-option="dict" data-value="{{?category}}">词典</a>
  <a class="link x-radio" href="/search?key={{?key}}&category=message" data-option="message" data-value="{{?category}}">备忘</a>
  <a class="link x-radio" href="/search?key={{?key}}&category=book" data-option="book" data-value="{{?category}}">图书</a>
</div>

<script type="text/javascript">
$(function () {
  $("#key").focus();

  // $("#searchForm [type=radio]").change(function () {
  //   $("#searchForm").submit();
  // })
});
</script>

{% include "mod_file_list.html" %}

{% end %}